/*
 * @Author: jykl jykl@163.com
 * @Date: 2024-12-10 20:53:07
 * @LastEditors: jykl jykl@163.com
 * @LastEditTime: 2025-01-02 11:31:12
 * @FilePath: /react-management/src/api/request.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { message } from 'antd';
import axios from 'axios'

const server = axios.create({
    baseURL: 'http://blogapi.shbwyz.com/',
  timeout: 5000
})

server.interceptors.request.use(config => {
  return config
})

server.interceptors.response.use(res => {
    
    if (res.status === 200) return res.data
  message.error(res.data.message)
}, err => {
  return Promise.reject(err)
})

export default server
